periodics:
- name: periodic-cluster-api-provider-aws-e2e{{ if ne $.branch "main" }}-{{ ReplaceAll $.branch "." "-" }}{{ end }}
  cluster: eks-prow-build-cluster
  decorate: true
  decoration_config:
    timeout: 5h
  rerun_auth_config:
    github_team_slugs:
      - org: kubernetes-sigs
        slug: cluster-api-provider-aws-maintainers
  interval: 12h
  labels:
    preset-dind-enabled: "true"
    preset-kind-volume-mounts: "true"
    preset-service-account: "true"
    preset-aws-ssh: "true"
    preset-aws-credential: "true"
  extra_refs:
  - org: kubernetes-sigs
    repo: cluster-api-provider-aws
    base_ref: {{ $.branch }}
    path_alias: "sigs.k8s.io/cluster-api-provider-aws"
  spec:
    containers:
    - image: {{ $.config.TestImage }}
      command:
        - "runner.sh"
        - "./scripts/ci-e2e.sh"
      env:
      - name: BOSKOS_HOST
        value: "boskos.test-pods.svc.cluster.local"
      - name: AWS_REGION
        value: "us-west-2"
      # Parallelize tests
      - name: GINKGO_ARGS
        value: "-nodes 20 -skip='\\[ClusterClass\\]'"
      securityContext:
        privileged: true
      resources:
        requests:
          cpu: 2
          memory: "9Gi"
        limits:
          cpu: 2
          memory: "9Gi"
  annotations:
    testgrid-dashboards: sig-cluster-lifecycle-cluster-api-provider-aws
    testgrid-tab-name: periodic-e2e-{{ ReplaceAll $.branch "." "-" }}
    testgrid-alert-email: sig-cluster-lifecycle-cluster-api-aws-alerts@kubernetes.io
    testgrid-num-failures-to-alert: "2"
- name: periodic-cluster-api-provider-aws-e2e-eks-canary{{ if ne $.branch "main" }}-{{ ReplaceAll $.branch "." "-" }}{{ end }}
  cluster: eks-prow-build-cluster
  decorate: true
  decoration_config:
    timeout: 5h
  rerun_auth_config:
    github_team_slugs:
      - org: kubernetes-sigs
        slug: cluster-api-provider-aws-maintainers
  interval: 12h
  labels:
    preset-dind-enabled: "true"
    preset-kind-volume-mounts: "true"
    preset-service-account: "true"
    preset-aws-ssh: "true"
    preset-aws-credential: "true"
  extra_refs:
  - org: kubernetes-sigs
    repo: cluster-api-provider-aws
    base_ref: {{ $.branch }}
    path_alias: "sigs.k8s.io/cluster-api-provider-aws"
  spec:
    containers:
    - image: {{ $.config.TestImage }}
      command:
        - "runner.sh"
        - "./scripts/ci-e2e.sh"
      env:
      - name: BOSKOS_HOST
        value: "boskos.test-pods.svc.cluster.local"
      - name: AWS_REGION
        value: "us-west-2"
      # Parallelize tests
      - name: GINKGO_ARGS
        value: "-nodes 20 -skip='\\[ClusterClass\\]'"
      securityContext:
        privileged: true
      resources:
        limits:
          cpu: 2
          memory: "9Gi"
        requests:
          cpu: 2
          memory: "9Gi"
  annotations:
    testgrid-dashboards: sig-k8s-infra-canaries
    testgrid-tab-name: periodic-aws-e2e-{{ ReplaceAll $.branch "." "-" }}-canary
    testgrid-num-columns-recent: "6"
- name: periodic-cluster-api-provider-aws-eks-e2e{{ if ne $.branch "main" }}-{{ ReplaceAll $.branch "." "-" }}{{ end }}
  cluster: eks-prow-build-cluster
  decorate: true
  decoration_config:
    timeout: 5h
  rerun_auth_config:
    github_team_slugs:
      - org: kubernetes-sigs
        slug: cluster-api-provider-aws-maintainers
  interval: 12h
  labels:
    preset-dind-enabled: "true"
    preset-kind-volume-mounts: "true"
    preset-service-account: "true"
    preset-aws-ssh: "true"
    preset-aws-credential: "true"
  extra_refs:
  - org: kubernetes-sigs
    repo: cluster-api-provider-aws
    base_ref: {{ $.branch }}
    path_alias: "sigs.k8s.io/cluster-api-provider-aws"
  spec:
    containers:
    - image: {{ $.config.TestImage }}
      command:
        - "runner.sh"
        - "./scripts/ci-e2e-eks.sh"
      env:
      - name: BOSKOS_HOST
        value: "boskos.test-pods.svc.cluster.local"
      - name: AWS_REGION
        value: "us-west-2"
      securityContext:
        privileged: true
      resources:
        requests:
          cpu: 2
          memory: "9Gi"
        limits:
          cpu: 2
          memory: "9Gi"
  annotations:
    testgrid-dashboards: sig-cluster-lifecycle-cluster-api-provider-aws
    testgrid-tab-name: periodic-eks-e2e-{{ ReplaceAll $.branch "." "-" }}
    testgrid-alert-email: sig-cluster-lifecycle-cluster-api-aws-alerts@kubernetes.io
    testgrid-num-failures-to-alert: "2"
- name: periodic-cluster-api-provider-aws-e2e-conformance{{ if ne $.branch "main" }}-{{ ReplaceAll $.branch "." "-" }}{{ end }}
  cluster: eks-prow-build-cluster
  decorate: true
  decoration_config:
    timeout: 5h
  rerun_auth_config:
    github_team_slugs:
      - org: kubernetes-sigs
        slug: cluster-api-provider-aws-maintainers
  interval: 12h
  labels:
    preset-dind-enabled: "true"
    preset-kind-volume-mounts: "true"
    preset-service-account: "true"
    preset-aws-ssh: "true"
    preset-aws-credential: "true"
  extra_refs:
    - org: kubernetes-sigs
      repo: cluster-api-provider-aws
      base_ref: {{ $.branch }}
      path_alias: "sigs.k8s.io/cluster-api-provider-aws"
  spec:
    containers:
      - image: {{ $.config.TestImage }}
        command:
          - "runner.sh"
          - "./scripts/ci-conformance.sh"
        env:
          - name: BOSKOS_HOST
            value: "boskos.test-pods.svc.cluster.local"
          - name: AWS_REGION
            value: "us-west-2"
          # Parallelize tests
          - name: GINKGO_ARGS
            value: "-nodes 20"
        securityContext:
          privileged: true
        resources:
          requests:
            cpu: 2
            memory: "9Gi"
          limits:
            cpu: 2
            memory: "9Gi"
  annotations:
    testgrid-dashboards: sig-cluster-lifecycle-cluster-api-provider-aws
    testgrid-tab-name: periodic-conformance-{{ ReplaceAll $.branch "." "-" }}
    testgrid-alert-email: sig-cluster-lifecycle-cluster-api-aws-alerts@kubernetes.io
    testgrid-num-failures-to-alert: "2"
- name: periodic-cluster-api-provider-aws-e2e-conformance-with-k8s-ci-artifacts{{ if ne $.branch "main" }}-{{ ReplaceAll $.branch "." "-" }}{{ end }}
  cluster: eks-prow-build-cluster
  max_concurrency: 1
  labels:
    preset-dind-enabled: "true"
    preset-kind-volume-mounts: "true"
    preset-service-account: "true"
    preset-aws-ssh: "true"
    preset-aws-credential: "true"
  decorate: true
  decoration_config:
    timeout: 5h
  rerun_auth_config:
    github_team_slugs:
      - org: kubernetes-sigs
        slug: cluster-api-provider-aws-maintainers
  interval: 12h
  extra_refs:
    - org: kubernetes-sigs
      repo: cluster-api-provider-aws
      base_ref: {{ $.branch }}
      path_alias: "sigs.k8s.io/cluster-api-provider-aws"
    - org: kubernetes-sigs
      repo: image-builder
      base_ref: main
      path_alias: "sigs.k8s.io/image-builder"
    - org: kubernetes
      repo: kubernetes
      base_ref: master
      path_alias: k8s.io/kubernetes
  spec:
    containers:
      - image: {{ $.config.TestImage }}
        env:
          - name: BOSKOS_HOST
            value: "boskos.test-pods.svc.cluster.local"
          - name: AWS_REGION
            value: "us-west-2"
          - name: E2E_ARGS
            value: "-kubetest.use-ci-artifacts"
          # Parallelize tests
          - name: GINKGO_ARGS
            value: "-nodes 20"
        command:
          - "runner.sh"
          - "./scripts/ci-conformance.sh"
        # we need privileged mode in order to do docker in docker
        securityContext:
          privileged: true
        resources:
          requests:
            # these are both a bit below peak usage during build
            # this is mostly for building kubernetes
            memory: "9Gi"
            cpu: 2
          limits:
            cpu: 2
            memory: "9Gi"
  annotations:
    testgrid-dashboards: sig-cluster-lifecycle-cluster-api-provider-aws
    testgrid-tab-name: periodic-conformance-{{ ReplaceAll $.branch "." "-" }}-k8s-main
    testgrid-num-columns-recent: '20'
    testgrid-alert-email: release-team@kubernetes.io, sig-cluster-lifecycle-cluster-api-aws-alerts@kubernetes.io
{{- if eq $.branch "main" }}
- name: periodic-cluster-api-provider-aws-coverage
  cluster: eks-prow-build-cluster
  interval: 24h
  decorate: true
  rerun_auth_config:
    github_team_slugs:
      - org: kubernetes-sigs
        slug: cluster-api-provider-aws-maintainers
  path_alias: "sigs.k8s.io/cluster-api-provider-aws"
  extra_refs:
    - org: kubernetes-sigs
      repo: cluster-api-provider-aws
      base_ref: {{ $.branch }}
      path_alias: "sigs.k8s.io/cluster-api-provider-aws"
    - org: kubernetes
      repo: test-infra
      base_ref: master
      path_alias: k8s.io/test-infra
  spec:
    containers:
      - image: {{ $.config.TestImage }}
        command:
          - runner.sh
          - bash
        args:
          - -c
          - |
            result=0
            ./scripts/ci-test-coverage.sh || result=$?
            cp coverage.* ${ARTIFACTS}
            cd ../../k8s.io/test-infra/gopherage
            GO111MODULE=on go build .
            ./gopherage filter --exclude-path="zz_generated,generated\.go" "${ARTIFACTS}/coverage.out" > "${ARTIFACTS}/filtered.cov" || result=$?
            ./gopherage html "${ARTIFACTS}/filtered.cov" > "${ARTIFACTS}/coverage.html" || result=$?
            ./gopherage junit --threshold 0 "${ARTIFACTS}/filtered.cov" > "${ARTIFACTS}/junit_coverage.xml" || result=$?
            exit $result
        resources:
          requests:
            cpu: "8"
            memory: "16Gi"
          limits:
            cpu: "8"
            memory: "16Gi"
        securityContext:
          privileged: true
{{- end }}
